<?php echo $userCommentPager->renderNavigationTop();?>
<table class="data-table" id="my-comment-table">
    <col width="1">
    <col width="1">
    <col>
    <col>
    <col width="1">
    <thead>
        <tr class="first last">
            <th>Date</th>
            <th>Type</th>
            <th>Name</th>
            <th>Comment</th>
        </tr>
    </thead>
    <tbody>
        <?php 
            foreach ($userCommentPager as $comment):
                $item = $comment->getRecord();
        ?>

        <tr class="first odd">
            <td><?php echo date('d/m/Y',strtotime($comment->created_at))?></td>
            <td><span class="nobr">
                    <?php
                         $item = Doctrine_Core::getTable($comment->record_model)->find($comment->record_id);
                         if($comment->record_model == 'DmComment')
                         {
                            $ancestors = $comment->getNode()->getAncestors();
                            foreach($ancestors as $ancestor)
                            {
                                if($ancestor->id == $ancestor->root_id || !$ancestor->root_id)
                                {
                                    echo ($ancestor->record_model == 'LrArticle')?'News':$ancestor->record_model;
                                    break;
                                }
                            }
                         }
                         else
                         {
                             echo ($comment->record_model == 'LrArticle')?'News':$comment->record_model;
                         }
                    ?>
                </span>
            </td>
            <td><?php echo $item?></td>
            <td><?php echo $comment->body?></td>
        </tr>
        <?php endforeach;?>

    </tbody>
</table>
<?php echo $userCommentPager->renderNavigationBottom();?>
